package com.woniuxy.commons.entity;

import com.woniuxy.commons.entity.wyh.StudentScore;
import com.woniuxy.commons.entity.wyh.TeamInfo;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @Auther: 牟强
 * @Date: 2020/7/16/016 15:43
 * @Description: 学生类
 */
@Data
@Accessors(chain = true)
public class StudentInfo implements Serializable {
    private int stuid;
    private String sname;//姓名
    private String account;//账号
    private String pwd;//密码
    private String phone;//手机
    private int classid;//所在班级id
    private String gender;//性别
    private int schoolid;//学校id
    private int badstudent;//差生计数，大于等于5就放入差生池，小于等于3从差生池取出
    private String birthday;//生日
    private String email;//邮箱
    private String middleexamination;//中考分数
    private int isQuit; //是否已经退学，1代表已经退学，0代表为退学

    private SchoolInfo schoolInfo;  //学校
    private TeamInfo teamInfo;      //班级
    private String imagehead;//头像
    private List<TestPaper> testPapers;//试卷

    private List<StudentScore> studentScores;//考数成绩信息

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof StudentInfo)) return false;
        StudentInfo that = (StudentInfo) o;
        return getClassid() == that.getClassid() &&
                getSchoolid() == that.getSchoolid() &&
                Objects.equals(getSname(), that.getSname()) &&
                Objects.equals(getAccount(), that.getAccount()) &&
                Objects.equals(getPhone(), that.getPhone()) &&
                Objects.equals(getEmail(), that.getEmail());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getSname(), getAccount(), getPhone(), getClassid(), getSchoolid(), getEmail());
    }
}
